/*
 * InvertedIndex.h
 *
 *  Created on: Mar 8, 2013
 *      Author: neo
 */

#ifndef _INVERTED_INDEX_H__
#define _INVERTED_INDEX_H__

#include <vector>
#include "../report-model/Term.h"

using std::vector;

class AbstractBugReport;
class Postings;
class Term;

class InvertedIndex {
  friend class AbstractIndexingPolicy;
private:

  vector<Postings*> m_index;

  Postings* get_postings(const Term& term);

  void add_report(const vector<Term>& terms, AbstractBugReport& bug_report);

public:
  void get_reports(const vector<Term>& terms,
      vector<AbstractBugReport*>& candidate_collector);

  InvertedIndex(int max_term_id);

  ~InvertedIndex();

};

#endif /* _INVERTED_INDEX_H__ */
